package com.ruoyi.members.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.members.mapper.SysMembersMapper;
import com.ruoyi.members.domain.SysMembers;
import com.ruoyi.members.service.ISysMembersService;

/**
 * 会员Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-15
 */
@Service
public class SysMembersServiceImpl extends ServiceImpl<SysMembersMapper,SysMembers> implements ISysMembersService
{
    @Autowired
    private SysMembersMapper sysMembersMapper;

    /**
     * 查询会员
     * 
     * @param membersId 会员主键
     * @return 会员
     */
    @Override
    public SysMembers selectSysMembersByMembersId(Long membersId)
    {
        return sysMembersMapper.selectSysMembersByMembersId(membersId);
    }

    /**
     * 查询会员列表
     * 
     * @param sysMembers 会员
     * @return 会员
     */
    @Override
    public List<SysMembers> selectSysMembersList(SysMembers sysMembers)
    {
        return sysMembersMapper.selectSysMembersList(sysMembers);
    }

    /**
     * 新增会员
     * 
     * @param sysMembers 会员
     * @return 结果
     */
    @Override
    public int insertSysMembers(SysMembers sysMembers)
    {
        sysMembers.setCreateTime(DateUtils.getNowDate());
        return sysMembersMapper.insertSysMembers(sysMembers);
    }

    /**
     * 修改会员
     * 
     * @param sysMembers 会员
     * @return 结果
     */
    @Override
    public int updateSysMembers(SysMembers sysMembers)
    {
        sysMembers.setUpdateTime(DateUtils.getNowDate());
        return sysMembersMapper.updateSysMembers(sysMembers);
    }

    /**
     * 批量删除会员
     * 
     * @param membersIds 需要删除的会员主键
     * @return 结果
     */
    @Override
    public int deleteSysMembersByMembersIds(Long[] membersIds)
    {
        return sysMembersMapper.deleteSysMembersByMembersIds(membersIds);
    }

    /**
     * 删除会员信息
     * 
     * @param membersId 会员主键
     * @return 结果
     */
    @Override
    public int deleteSysMembersByMembersId(Long membersId)
    {
        return sysMembersMapper.deleteSysMembersByMembersId(membersId);
    }
}
